#include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
const ll N = 1e5 + 5, mod = 1e9 + 7, inf = 2e18;

int n, m;
ll a[N];

void solve()
{
    cin >> n >> m;
    while (n--)
    {
        ll k, c, pos;
        cin >> k >> c;
        ll vlu = ceil(c * 1.0 / k);
        k--;

        while (k--)
        {
            cin >> pos;
            a[pos] += vlu;
        }
    }
    for (int i = 1; i <= m; i++)
    {
        cout << a[i] << " ";
    }
}

int main()
{  
    solve();

    return 0;
}

